package cn.com.surker.system.dao;

import cn.com.surker.system.entity.SysMenuInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 菜单表 Mapper 接口
 * </p>
 *
 * @author lucky
 * @since 2021-02-24
 */
public interface SysMenuInfoDao extends BaseMapper<SysMenuInfo> {


    /**
     * 查询子菜单
     * @param uid 用户ID
     * @param orgId 部门ID
     * @param status 状态(0:启用,1:禁用)
     * @param type 类型 0手机端 1后台管理
     * @param pid 父级菜单ID
     * @return
     */
    List<Map<String, Object>> queryUserChildrenMenu(Long uid, Long orgId, Integer status, Integer type, Long pid);

    /**
     * 查询OA菜单
     * @param uid 用户ID
     * @param orgId 部门ID
     * @param status 状态(0:启用,1:禁用)
     * @param pid 父级菜单ID
     * @return
     */
    List<Map<String, Object>> queryOaUserChildrenMenu(Long uid, Long orgId, Integer status, Long pid);

    /**
     * 查询OA及旭科云子菜单
     * @param uid 用户ID
     * @param orgId 部门ID
     * @param status 状态(0:启用,1:禁用)
     * @param pid 父级菜单ID
     * @return
     */
    List<Map<String, Object>> queryOaUserChildrenMenuV1(Long uid, Long orgId, Integer status, Long pid);

    /**
     * ERP菜单
     * @param uid
     * @param orgId
     * @param status
     * @param pid
     * @return
     */
    List<Map<String, Object>> queryErpUserChildrenMenuV2(Long uid, Long orgId, Integer status, Integer type, Long pid);


    /**
     * 查询子菜单
     * @param type 类型 0手机端 1后台管理
     * @param pid 父级菜单ID
     * @return
     */
    List<Map<String, Object>> queryChildrenMenu(Long type, Long pid);

    /**
     * 查询菜单管理按钮信息
     * @param uid 用户ID
     * @param mid 菜单ID
     * @return
     */
    List<Map<String, Object>> queryButton(Long uid, Long mid);

    /**
     * 查询菜单总条数
     * @param menuInfo
     * @return
     */
    Integer queryMenuTotal(SysMenuInfo menuInfo);

    /**
     * 根据菜单、角色查询是否有权限
     * @param mid
     * @param uid
     * @return
     */
    Integer queryMenuRole(Long mid, Long uid);

}
